package com.aya.simple.handler;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@Controller
public class CustomHandlerMethod {
    /**
     * 通过如下方式访问，会匹配  org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping
     * http://localhost:8080/handlermethod
     */
    @ResponseBody
    @RequestMapping("handlermethod")
    public String  handlerMethod(HttpServletResponse response) throws IOException {
        return "HandlerMethod，自定义方法的形式，想怎么写就怎么写";
    }
}
